home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / misc / emu / ST4Amiga.lha / ST / SAVEROM.PAS < prev    next >
Pascal/Delphi Source File  |  1995-04-24  |  1KB  |  36 lines

  1. PROGRAM SaveROM;
  2. { (C) by Stefan Haubenthal 1993/94 }
  3. { DISCLAIMER:  Usage of this image file is reserved for those users who
  4. are already in posession of an Atari ST and thus having a legal right to
  5. use the ROM software. This method is intended for those who lack the ability
  6. to extract the image due to hardware shortcomings or system damage. }
  7.  
  8. USES    DOS;
  9. CONST   Name='TOS.IMG';
  10.         Len=$4000;
  11. VAR     PtrROM,ROM:^LongInt;
  12.         SP : Pointer;   { Used to save stack pointer. }
  13.         Image:FILE;
  14.         Max:INTEGER;
  15.         Block:LongInt;
  16.         Buffer:PACKED ARRAY [1..Len] OF Byte;
  17.  
  18. BEGIN
  19. Sp := Super(NIL);     { Enter Supervisor mode. }
  20. PtrROM:=Ptr($4f2);
  21. ROM:=Ptr(PtrROM^);
  22. WriteLn('Saving ',Name,' V',LoWord(Hi(ROM^)),'.',LoWord(Lo(ROM^)));
  23. ReWrite(Image,Name);
  24. Max:=$30000 DIV Len-1;
  25. FOR Block:=0 TO Max DO
  26.         BEGIN
  27.         ROM:=Ptr(PtrROM^+Block*Len);
  28.         IF Block<Max THEN Move(ROM^,Buffer,Len)
  29.                      ELSE BEGIN
  30.                           Move(ROM^,Buffer,Len-1);
  31.                           Buffer[Len]:=$5c;
  32.                           END;
  33.         BlockWrite(Image,Buffer,Len);
  34.         END;
  35. END.
  36.